package com.campus.counseling.controller;

import com.campus.counseling.model.common.Result;
import com.campus.counseling.model.vo.SystemLoadVO;
import com.campus.counseling.service.SystemMonitorService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "系统监控")
@RestController
@RequestMapping("/api/system/monitor")
@RequiredArgsConstructor
public class SystemMonitorController {
    
    private final SystemMonitorService systemMonitorService;
    
    @GetMapping("/load")
    @Operation(summary = "获取系统负载信息")
    public Result<SystemLoadVO> getSystemLoad() {
        return Result.success(systemMonitorService.getSystemLoad());
    }
    
    @GetMapping("/status")
    @Operation(summary = "获取系统状态")
    public Result<String> getSystemStatus() {
        return Result.success(systemMonitorService.getSystemStatus());
    }
} 